{* Smarty *}
{*
 *  This file is part of Urd.
 *
 *  Urd is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *  Urd is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. See the file "COPYING". If it does not
 *  exist, see <http://www.gnu.org/licenses/>.
 *
 * $LastChangedDate: 2008-03-28 22:50:18 +0100 (Fri, 28 Mar 2008) $
 * $Rev: 1068 $
 * $Author: gavinspearhead $
 * $Id: viewfiles.tpl 1068 2008-03-28 21:50:18Z gavinspearhead $
 *}
{include file="head.tpl" title=$title}
{* used for both prefs and admin_config !! *}

<h3>{$heading}</h3>{$__messages}

{if $saved eq 1}<span class="Message">{$LN_pref_saved}</span>{/if}
{if $imported eq 1}<span class="Message">{$LN_settings_imported}</span>{/if}
<form method="post" action="" id="settings_form">
<div>
<input type="hidden" name="current_pref_level" id="current_pref_level"/>
<input type="hidden" name="challenge" id="challenge" value="{$challenge}"/>
</div>
<table class="preferences">
{section name=y loop=$pref_list}
<tr class="transferstatus">
<td colspan="2" class="newpref">{$pref_list[y].name}</td>
</tr>
{assign var=block value=$pref_list[y].value}
{section name=x loop=$block}
{assign var=b_type  value=$block[x]->get_type()}

{if $block[x]->level > $level}
{assign var=hidden value="hidden"}
{else}
{assign var=hidden value=""}
{/if}
<tr class="{$hidden} {cycle values="even" name="cycle1"}  {if $block[x]->tr_class neq ''} {$block[x]->tr_class} {/if}"
{if $block[x]->tr_id neq ''}id="{$block[x]->tr_id}" {/if}
>
<td {popup text=$block[x]->popup|escape width=400 } >
	{$block[x]->text}:
</td>
<td>
{if $b_type eq "plain"} 
	<b>{$block[x]->value} </b>
{/if}
{if $b_type eq "password"}
	<input type="password" name="{$block[x]->name}" value="{$block[x]->value|escape:htmlall}" size="{$block[x]->size}" {$block[x]->javascript} />
{/if}
{if $b_type eq "text"}
	<input type="text" name="{$block[x]->name}" value="{$block[x]->value|escape:htmlall}" size="{$block[x]->size}"  {$block[x]->javascript} />
{/if}
{if $b_type eq "checkbox"}
	<input type="checkbox" name="{$block[x]->name}" {if $block[x]->toggle eq 1 } checked="checked" {/if}  {$block[x]->javascript} />
{/if}
{if $b_type eq "textarea"}
    {assign var="name" value="$block[x]->name|replace:'[]':''}
    <input type="hidden" id="{$name}_orig_size" value="{$block[x]->rows}"/>
    <textarea name="{$block[x]->name}" id="{$name}_select" rows="2" cols="{$block[x]->cols}" {$block[x]->javascript} >{$block[x]->value|escape:htmlall}
    </textarea>
    <div id="{$name}_collapse" class="floatright iconsize dynimgplus noborder buttonlike" onclick="javascript:collapse_select('{$name}','rows');;"  {popup text="$LN_expand"} >
    </div>
{*<img src="{$IMGDIR}/icon_triangle_down.png" id="{$name}_collapse" onclick="javascript:collapse_select('{$name}', 'rows');" {popup text="$LN_expand"} alt="expand"/> *}
{/if}
{if $b_type eq "select"}
{assign var=opts value=$block[x]->options}
<select name="{$block[x]->name}" id="{$block[x]->name}_select"  {$block[x]->javascript} >
{foreach from=$opts item=q key=k }
<option value="{$k}" {if $k eq $block[x]->selected} selected="selected" {/if} >{$q}</option>
{/foreach}
</select>
	{*html_options name=$block[x]->name options=$block[x]->options selected=$block[x]->selected|escape *}
{/if}
{if $b_type eq "multiselect"}
    {assign var="name" value="$block[x]->name|replace:'[]':''}
    <input type="hidden" id="{$name}_orig_size" value="{$block[x]->size}"/>
    <select name="{$block[x]->name}" id="{$name}_select" size="2" multiple="multiple" {$block[x]->javascript} >
    {assign var=opts value=$block[x]->options_triple}
    {foreach from=$opts item=q }
        <option value="{$q.id}" {if $q.on eq 1} selected="selected" {/if} >{$q.name}</option>
    {/foreach}
    </select>
    {*<img src="{$IMGDIR}/icon_triangle_down.png" id="{$name}_collapse" onclick="javascript:collapse_select('{$name}','size');" {popup text="$LN_expand"} alt="expand" />*} 
    <div id="{$name}_collapse" class="floatright iconsize dynimgplus noborder buttonlike" onclick="javascript:collapse_select('{$name}','size');;" {popup text="$LN_expand"} >
    </div>
{/if}
{if $b_type eq "period"}
    <select name="{$block[x]->period_name}" size="1" class="update" {$block[x]->javascript} >
    {html_options values=$block[x]->period_keys output=$block[x]->period_texts selected=$block[x]->period_selected } 
    </select> @
    <input type="text" id="{$block[x]->time1_name}" name="{$block[x]->time1_name}" {if $block[x]->time1_value ge 0}value="{$block[x]->time1_value}{/if}" class="time" {$extra_param} />:
    <input type="text" id="{$block[x]->time2_name}" name="{$block[x]->time2_name}" {if $block[x]->time2_value ge 0}value="{$block[x]->time2_value}{/if}" class="time" {$extra_param}/>
    {if $block[x]->extra_name neq ""}
    {html_options name=$block[x]->extra_name options=$block[x]->extra_options selected=$block[x]->extra_selected }
{/if}
{/if}

{if $block[x]->error_msg.image neq " "}
<img src="{$IMGDIR}/stop_mark.png" {popup text=$block[x]->error_msg.msg caption=$block[x]->error_msg.hdr|escape:htmlall width=400 } alt="{$block[x]->error_msg.msg|escape}" class="noborder" />
{/if}
</td>
</tr>
{/section}
{/section}
</table>
<table class="prefsubmit">
<tr><td class="center">
<input type="submit" value="{$LN_apply}" class="submit" alt="{$LN_apply}" name="submit_button"/>
<input type="submit" value="{$LN_reset}" class="submit" alt="{$LN_reset}" name="reset"/>
<input type="submit" value="{$LN_settings_export}" class="submit" alt="{$LN_settings_export}" name="save_settings"/>
<input type="button" value="{$LN_settings_import}" class="submit" alt="{$LN_settings_import}" name="load_settings" onclick="javascript:show_popup_remote('loadsettingsdiv','loadsettings', '{$referrer}');"/>
</td>
</tr>
</table>
</form>
<p>&nbsp;</p>

<div id="loadsettingsdiv" class="loadsettingsoff">
</div>

{include file="foot.tpl"}
